<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .content{
            width: 200px;
            height: 200px;
            border: 1px solid #333;
            line-height: 200px;
            text-align: center;
        }
        input.active{
            background-color: red;
        }
    </style>
</head>
<body>
    <div id="app">
        <input type="button" @click="tab(0)" :class="{active: num===0}" value="1">
        <input type="button" @click="tab(1)" :class="{active: num===1}" value="2">
        <input type="button" @click="tab(2)" :class="{active: num===2}" value="3">
        <div class="content" v-show="num===0">1</div>
        <div class="content" v-show="num===1">2</div>
        <div class="content" v-show="num===2">3</div>
    </div>
    <script src="./vue.js"></script>
    <script>
        const vm = new Vue({
            el: '#app',
            data:{
               num: 0
            },
            methods:{
                tab(n){
                    this.num = n;
                }
            }
        })
        
    </script>
</body>
</html>